require"import"
import"android.content.Context"
import"android.media.AudioManager"
import "com.androlua.*"
import"android.bluetooth.BluetoothAdapter"
local audioManager=service.getSystemService(this.AUDIO_SERVICE)
 local speakerMode= audioManager.isSpeakerphoneOn()
 local bt= BluetoothAdapter.getDefaultAdapter()
 audioManager.setStreamVolume(AudioManager.STREAM_VOICE_CALL,
 AudioManager.STREAM_MUSIC,
 AudioManager.STREAM_ACCESSIBILITY)
if speakerMode == true
 audioManager.setSpeakerphoneOn(false)
 bt.disable()
 this.speak("Đã tắt âm thanh riêng biệt")
elseif speakerMode == false
 audioManager.setSpeakerphoneOn(true)
 bt.enable()
service.speak("Đã bật âm thanh riêng biệt")
 end
 return true